package com.tianzehua.decorator;

/**
 * 装饰类 {@link Component}
 * @author tianzehua
 * @date 2019/03/20
 */
public class Decorator implements Component{

    /* 1. 装饰类要实现抽象的构建类； 实现了Component
    *  2. 装饰角色要持有一个抽象角色的引用；  private Component component
    *  */

    private Component component;

    public Decorator(Component component){
        this.component = component;
    }
    @Override
    public void doSomething() {
        component.doSomething();
    }
}
